Skip to content

fix(cli): a daemon launched by daemon start that dies during that start reports DAEMON_STARTUP_FAILED - #710

Merged
V3RON merged 8 commits into
mainfrom
bug/684
Oct 20, 2026
Merged

V3RON merged 8 commits into
mainfrom
bug/684

Conversation

@V3RON

@V3RON V3RON commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

What

Auto-launch checks status.get before handing the client to a command.
A close during that probe reports DAEMON_STARTUP_FAILED; later operation
losses retain DAEMON_CONNECTION_LOST, including a pending lease request.

Why

Closes #684. Scripts can distinguish the reported hello-then-close failed
start from losing a daemon during an operation. Exit remains 1.

How

One CLI connector retains its launch deadline through credential rejection
and agent fallback. The probe shares that deadline, closes failed clients,
and cancels its timer. Pre-existing connections and daemon refusals keep
their original errors. No typed-client or wire changes.

Done when

  • Triage hello-then-close regression retained; credential fallback covered.
  • Pending lease losses covered after both running and starting status answers; held lease and later request losses covered.
  • Probe timeout uses the original launch deadline and closes the client.
  • Pre-existing connections and explicit daemon refusals retain their codes.
  • CLI docs and module manual match the implementation.
  • pnpm test:changed: 4 files passed, 315 tests passed. Commit and push hooks passed.
  • Reviewed-head regressions fail on named assertions; all 13 startup-suite cases probed with deliberate defects or reviewed code.

Assumptions

  • Assumption: the triage's first answered post-handshake request is an explicit startup status probe, including a starting answer. Hello alone does not end classification; business operations do not extend it.
  • Assumption: the unreproduced exit-13 unsettled-await shape stays out of scope. Closes before hello answers and explicit DAEMON_STOPPING refusals retain their existing codes.

Status

Implement: done (38f75a22) Review: round 2 fix-check, complete Hardware: n/a Gate: running
Next: gate

Review

Spec review: 0 blocking, 0 fixed, 0 notes. Code review: 2 blocking, 2 fixed, 0 notes. Claims review: 0 blocking, 0 fixed, 0 notes.
Rounds: 2. Tokens: 1.1M.
Runs: 11. Cost USD: 2.4268. Agent seconds: 1156.

Rejected:

  • spec: the probe is an explicit status request, not a wrapper, so the first request after hello is the probe [intentional]
  • spec: the timeout narrows to the startup probe, and docs/CLI.md says so [intentional]
  • spec: credential-fallback tests cover existing behaviour now wrapped by the connector [nonblocking]
  • spec: explicit DAEMON_STOPPING and silent-probe tests follow from the assumptions [nonblocking]

Written by an agent.

V3RON added 2 commits October 19, 2026 10:42
…r a daemon that never came up

why: the auto-launch loop hands back the poll's own connection the moment the
launched daemon answers `hello`, and that connection's close — the dying
daemon's `http-start-failed` stop, not any daemon the command ever had — is
what the client then reports. Docs reserve that code for a live connection
that died, so the test asserts the start-failure code #672 gave this path's
timeout sibling.
1 failing -> 0 failing. Keep the startup classification on the launched client until its first successful request; preserve later and pre-existing connection losses. Carry the triage regression, exercise a pending first request and mid-operation deaths, and update the CLI contract docs.
@V3RON
V3RON marked this pull request as ready for review October 19, 2026 14:49
@V3RON
V3RON merged commit 3be34ed into main Oct 20, 2026
26 checks passed
@V3RON
V3RON deleted the bug/684 branch October 20, 2026 06:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

daemon start reports DAEMON_CONNECTION_LOST for a daemon that never came up

1 participant